# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Docs.V1.Model.Document do
  @moduledoc """
  A Google Docs document.

  ## Attributes

  *   `body` (*type:* `GoogleApi.Docs.V1.Model.Body.t`, *default:* `nil`) - Output only. The main body of the document. Legacy field: Instead, use Document.tabs.documentTab.body, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `documentId` (*type:* `String.t`, *default:* `nil`) - Output only. The ID of the document.
  *   `documentStyle` (*type:* `GoogleApi.Docs.V1.Model.DocumentStyle.t`, *default:* `nil`) - Output only. The style of the document. Legacy field: Instead, use Document.tabs.documentTab.documentStyle, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `footers` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.Footer.t}`, *default:* `nil`) - Output only. The footers in the document, keyed by footer ID. Legacy field: Instead, use Document.tabs.documentTab.footers, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `footnotes` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.Footnote.t}`, *default:* `nil`) - Output only. The footnotes in the document, keyed by footnote ID. Legacy field: Instead, use Document.tabs.documentTab.footnotes, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `headers` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.Header.t}`, *default:* `nil`) - Output only. The headers in the document, keyed by header ID. Legacy field: Instead, use Document.tabs.documentTab.headers, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `inlineObjects` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.InlineObject.t}`, *default:* `nil`) - Output only. The inline objects in the document, keyed by object ID. Legacy field: Instead, use Document.tabs.documentTab.inlineObjects, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `lists` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.List.t}`, *default:* `nil`) - Output only. The lists in the document, keyed by list ID. Legacy field: Instead, use Document.tabs.documentTab.lists, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `namedRanges` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.NamedRanges.t}`, *default:* `nil`) - Output only. The named ranges in the document, keyed by name. Legacy field: Instead, use Document.tabs.documentTab.namedRanges, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `namedStyles` (*type:* `GoogleApi.Docs.V1.Model.NamedStyles.t`, *default:* `nil`) - Output only. The named styles of the document. Legacy field: Instead, use Document.tabs.documentTab.namedStyles, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `positionedObjects` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.PositionedObject.t}`, *default:* `nil`) - Output only. The positioned objects in the document, keyed by object ID. Legacy field: Instead, use Document.tabs.documentTab.positionedObjects, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `revisionId` (*type:* `String.t`, *default:* `nil`) - Output only. The revision ID of the document. Can be used in update requests to specify which revision of a document to apply updates to and how the request should behave if the document has been edited since that revision. Only populated if the user has edit access to the document. The revision ID is not a sequential number but an opaque string. The format of the revision ID might change over time. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the document has not changed. Conversely, a changed ID (for the same document and user) usually means the document has been updated. However, a changed ID can also be due to internal factors such as ID format changes.
  *   `suggestedDocumentStyleChanges` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.SuggestedDocumentStyle.t}`, *default:* `nil`) - Output only. The suggested changes to the style of the document, keyed by suggestion ID. Legacy field: Instead, use Document.tabs.documentTab.suggestedDocumentStyleChanges, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `suggestedNamedStylesChanges` (*type:* `%{optional(String.t) => GoogleApi.Docs.V1.Model.SuggestedNamedStyles.t}`, *default:* `nil`) - Output only. The suggested changes to the named styles of the document, keyed by suggestion ID. Legacy field: Instead, use Document.tabs.documentTab.suggestedNamedStylesChanges, which exposes the actual document content from all tabs when the includeTabsContent parameter is set to `true`. If `false` or unset, this field contains information about the first tab in the document.
  *   `suggestionsViewMode` (*type:* `String.t`, *default:* `nil`) - Output only. The suggestions view mode applied to the document. Note: When editing a document, changes must be based on a document with SUGGESTIONS_INLINE.
  *   `tabs` (*type:* `list(GoogleApi.Docs.V1.Model.Tab.t)`, *default:* `nil`) - Tabs that are part of a document. Tabs can contain child tabs, a tab nested within another tab. Child tabs are represented by the Tab.childTabs field.
  *   `title` (*type:* `String.t`, *default:* `nil`) - The title of the document.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :body => GoogleApi.Docs.V1.Model.Body.t() | nil,
          :documentId => String.t() | nil,
          :documentStyle => GoogleApi.Docs.V1.Model.DocumentStyle.t() | nil,
          :footers => %{optional(String.t()) => GoogleApi.Docs.V1.Model.Footer.t()} | nil,
          :footnotes => %{optional(String.t()) => GoogleApi.Docs.V1.Model.Footnote.t()} | nil,
          :headers => %{optional(String.t()) => GoogleApi.Docs.V1.Model.Header.t()} | nil,
          :inlineObjects =>
            %{optional(String.t()) => GoogleApi.Docs.V1.Model.InlineObject.t()} | nil,
          :lists => %{optional(String.t()) => GoogleApi.Docs.V1.Model.List.t()} | nil,
          :namedRanges =>
            %{optional(String.t()) => GoogleApi.Docs.V1.Model.NamedRanges.t()} | nil,
          :namedStyles => GoogleApi.Docs.V1.Model.NamedStyles.t() | nil,
          :positionedObjects =>
            %{optional(String.t()) => GoogleApi.Docs.V1.Model.PositionedObject.t()} | nil,
          :revisionId => String.t() | nil,
          :suggestedDocumentStyleChanges =>
            %{optional(String.t()) => GoogleApi.Docs.V1.Model.SuggestedDocumentStyle.t()} | nil,
          :suggestedNamedStylesChanges =>
            %{optional(String.t()) => GoogleApi.Docs.V1.Model.SuggestedNamedStyles.t()} | nil,
          :suggestionsViewMode => String.t() | nil,
          :tabs => list(GoogleApi.Docs.V1.Model.Tab.t()) | nil,
          :title => String.t() | nil
        }

  field(:body, as: GoogleApi.Docs.V1.Model.Body)
  field(:documentId)
  field(:documentStyle, as: GoogleApi.Docs.V1.Model.DocumentStyle)
  field(:footers, as: GoogleApi.Docs.V1.Model.Footer, type: :map)
  field(:footnotes, as: GoogleApi.Docs.V1.Model.Footnote, type: :map)
  field(:headers, as: GoogleApi.Docs.V1.Model.Header, type: :map)
  field(:inlineObjects, as: GoogleApi.Docs.V1.Model.InlineObject, type: :map)
  field(:lists, as: GoogleApi.Docs.V1.Model.List, type: :map)
  field(:namedRanges, as: GoogleApi.Docs.V1.Model.NamedRanges, type: :map)
  field(:namedStyles, as: GoogleApi.Docs.V1.Model.NamedStyles)
  field(:positionedObjects, as: GoogleApi.Docs.V1.Model.PositionedObject, type: :map)
  field(:revisionId)

  field(:suggestedDocumentStyleChanges,
    as: GoogleApi.Docs.V1.Model.SuggestedDocumentStyle,
    type: :map
  )

  field(:suggestedNamedStylesChanges, as: GoogleApi.Docs.V1.Model.SuggestedNamedStyles, type: :map)

  field(:suggestionsViewMode)
  field(:tabs, as: GoogleApi.Docs.V1.Model.Tab, type: :list)
  field(:title)
end

defimpl Poison.Decoder, for: GoogleApi.Docs.V1.Model.Document do
  def decode(value, options) do
    GoogleApi.Docs.V1.Model.Document.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Docs.V1.Model.Document do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
